package study;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author 刘伟涛
 * @Date 2023/12/27 15:36
 **/
public class Demo5 {
    public static void main(String[] args){
        String[] people = {"Person A", "Person B", "Person C", "Person D", "Person E"};
        int daysPerWeek = 7;

        List<String> scheduled = new ArrayList<>();

        for (int i = 0; i < people.length; i++) {
            for (int j = i + 1; j < people.length; j++) {
                String schedule = people[i] + " - " + people[j];
                scheduled.add(schedule);
            }
        }

        int day = 1;
        for (String pair : scheduled) {
            System.out.println("Day " + day + ": " + pair);
            day++;
            if (day > daysPerWeek) {
                day = 1; // 回到周循环的第一天
            }
        }
    }
}
